home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Archives / Timing / UpTime17.lha / UpTime / install / CheckDir < prev    next >
Encoding:
AmigaDOS Script File  |  1993-09-23  |  1.1 KB  |  49 lines

  1. .key mypath/a,askuser
  2. ;
  3. ;   $VER: CheckDir 1.0 (23.09.93)
  4. ;
  5. ;   Written 21. September 1993 by J.Matern
  6. ;   This file is part of the 'UpTime'-package © by Jürgen Matern.
  7. ;   The package may be redistributed under limitations discribed
  8. ;   in the file 'UpTime.doc' which should have come with this
  9. ;   distribution. Read this file for more information!
  10. ;
  11. ;   Last changed: 23. September 1993
  12. ;
  13. set retcode 0
  14. unset askuser
  15. set askuser <askuser>
  16. if not exists "<mypath>"
  17.    if $askuser not eq "*$askuser"
  18.       echo "*N '<mypath>' does not exist."
  19.       echo " Shall I create it (y/n)? " noline
  20.       set >nil: yesno ?
  21.       if $yesno eq y
  22.          skip create
  23.       endif
  24.       set retcode 5
  25.       skip end
  26.    endif
  27.    lab create
  28.    makedir "<mypath>"
  29.    if warn
  30.       echo "*N Failed to create '<mypath>'."
  31.       set retcode 5
  32.       skip end
  33.    endif
  34. else
  35.    set fromdir `cd`
  36.    cd >nil: "<mypath>"
  37.    if warn
  38.       echo "*N Desired destination exists already as file!"
  39.       echo " Can't create directory: '<mypath>'."
  40.       cd $fromdir
  41.       set retcode 5
  42.       skip end
  43.    endif
  44.    cd $fromdir
  45. endif
  46.  
  47. lab end
  48. unset askuser
  49.